import dayjs from 'dayjs'
import { defineStore } from 'pinia'
import { useAppStore } from './app.js'

export const useOfficePostStore = defineStore('office_post',{
	state:()=>{
		return {
			create:{
				selected:[],
				drafts:[],
				createPromiseResolve:null,
				createPost:{
					title:'',
					digest:'',
					html:'',
					thumb_url:''
				}
			},
			posts:{
				selected:[]
			}
		}
	},
	actions:{
		async createOK(){
			let that = this
			return await new Promise((resolve)=>{
				that.create.createPromiseResolve = resolve
			})
		},
		ackCreateOK()
		{
			this.create.createPromiseResolve('HI')
		}
	}
})